package models;

import java.util.List;

public class Player
{
  public enum Team
  {
    BLUE,RED,TEAMLESS
  };
  public final Team;


  public PlayerHand myHand;


  public Player(int idPlayer)
  {
    this.id=idPlayer;
  }

  public void joinTeam(Team chosen) 
  {
    assert(chosen != Team.TEAMLESS && chosen !=null);	
    this.team=chosen;
  }

  public void fillHand(PlayerHand newHand)
  {
    if(myHand==null && newHand.size==8)
    {
      this.myHand=newHand;
    }
  }

  public void playCard(Card chosenCard)
  {
    if(this.myHand.gotCard(chosenCard) && game.isThisPlayable(chosenCard))
    {
      this.myHand.remove(chosenCard);
      game.currentTrick.addCard(chosenCard);      
    }
  }
  
  public void makeAnnounce(color color,int value)
  {
    if(value < game.getCurrentAnnounce.value)
    {
      game.makeNewAnnounce(color,value);
    }
  }
}	